package com.ruoyi.service.tourism.impl;

import com.ruoyi.mapper.tourism.BusinessLyMapper;
import com.ruoyi.service.tourism.BusinessLyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * @author zeo
 * @explain 滁州商管模块
 * @date 2021/2/2 9:45
 */
@Service
public class BusinessLyServiceImpl implements BusinessLyService {

    @Autowired
    BusinessLyMapper businessLyMapper;

    @Override
    public List<Map<String, Object>> findBusinessLyMonthList(Map map) {
        return businessLyMapper.findBusinessLyMonthList(map);
    }

    @Override
    public List<Map<String, Object>> findBusinessLyDayList(Map map) {
        return businessLyMapper.findBusinessLyDayList(map);
    }

    @Override
    public int addBusinessLy(Map map) {
        String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
        map.put("foreignId", uuid);
        businessLyMapper.addShare(map);
        return businessLyMapper.addBusinessLy(map);
    }

    @Override
    public Map findBusinessLyById(String id) {
        return businessLyMapper.findBusinessLyById(id);
    }

    @Override
    public int editBusinessLy(Map map) {
        return businessLyMapper.editBusinessLy(map) + businessLyMapper.editShare(map);
    }

    @Override
    public Map getLastDayData(Map map) {
        return businessLyMapper.getLastDayData(map);
    }
}
